<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<%@ include file="/taglibs.jsp"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="/css/yaodian100midend.css" rel="stylesheet" type="text/css" media="screen" />
<script language="javascript">
	$().ready(function(){
		$("#importDescImgBtn").click(function(){
			if ( 0 == $(":checkbox[name='importDescImg']:checked").size() ){
				alert("请选择要载入的描述图");
				return false;
			}else{
				var temp = "";
				$(":input[type=checkbox][name=importDescImg]").each(function(index,item){
					if ( $(this).attr("checked")){
						temp = temp + "<p><img src='" + $("#descImg_" + index).html() + "'/></p>";
					}
				});
				var oData = CKEDITOR.instances.description.getData();
				CKEDITOR.instances.description.setData( temp + oData);
				closeDialog();
			}
		});
		$("#selDescImgAll").click(function(){
			$(":input[id*=importDescImg_]").attr('checked',$("#selDescImgAll").attr('checked'));
		});
	});
</script>
</head>
<body>
<%
	response.setHeader("Pragma","No-Cache");  
	response.setHeader("Cache-Control","No-Cache");  
	response.setDateHeader("Expires",0);  
	long dateTime = new Date().getTime();
%>

	<table class="tb-1" width="100%">
		<tr>
			<th><input type="checkbox" id="selDescImgAll"></th>
			<th>图片</th>
			<th>路径</th>
			<th>描述</th>
			<th>顺序</th>
		</tr>		
		<c-rt:choose>
			<c-rt:when test="${not empty descImgs}">
				<c:forEach items="${descImgs}" var="image" varStatus="rows_index">
					<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}" id="tdDesc_${rows_index.count}" title="建立者:${image.createUser} 建立日期:${image.createDate}<br/>修改者:${image.modifyUser} 修改日期:${image.modifyDate}">
						<td><input type="checkbox" id="importDescImg_${rows_index.index}" name="importDescImg" value=""/></td>
						<td>
							<img src="${image.imgFilePath}?nocache=<%=dateTime%>" onError="this.src='/PImg/blank_75.gif'" width="75" height="75"/>
						</td>
						<td id="descImg_${rows_index.index}"><%=ServerValue.getImgDomain()%>${image.imgFilePath}</td>
						<td>${image.picDesc}</td>
						<td>${image.showSeq}</td>
					</tr>
				</c:forEach>
				<tr>
					<td colspan="5"><input type="button" id="importDescImgBtn" name="importDescImgBtn" value="导入"/></td>
				</tr> 
			</c-rt:when>
			<c-rt:otherwise>
				无描述图资料!!
			</c-rt:otherwise>
			</c-rt:choose>
	</table>
</body>
</html>